package org.apogeescience.connector.databases;

import java.util.Hashtable;
import java.util.List;
import java.util.Map;

import org.apogeescience.annotation.NamedQuery;

/**
 * Interface for all database types to implement
 * @author Isaac
 *
 */
public interface IDatabase {

	/**
	 * Initialize the database
	 * @return
	 */
	public boolean initialize();
	
	/**
	 * Generate the properly formatted query for the database
	 * @param tableName name of the table to query 
	 * @param namedQuery the named query to execute
	 * @param parameters parameters to add to the query
	 * @return Properly formatted query string for the database
	 */
	public String generateQuery(String tableName, NamedQuery namedQuery, Hashtable<String, Object> parameters);
	
	/**
	 * Executes the query and returns the results.
	 * @param query query to execute
	 * @return results
	 */
	public Map<String, List<Object>> executeQuery(StringBuilder query);
	
	/**
	 * Destroy anything here
	 */
	public void destroy();
	
}
